import http from '@/utils/http.js'

/**
 * 查询接口列表
 * @param {object} param
 */
export function getInterfaceList(param) {
  return http.get('/interface/list', {
    param
  })
}

/**
 * 添加接口信息
 * @param {object} data
 * @returns
 */
export function addInterface(data) {
  return http.post('/interface/', data)
}

/**
 * 更新接口信息
 * @param {object} data
 * @returns
 */
export function updateInterface(data) {
  return http.put('/interface/', data)
}

/**
 * 删除接口信息
 * @param {string} id
 * @returns
 */
export function deleteInterface(id) {
  return http.delete(`/interface/${id}`)
}

/**
 * 审核接口信息
 * @param {object} id
 * @returns
 */
export function approveInterface(id) {
  return http.put('/interface/approve', id)
}

/**
 * 下线接口信息
 * @param {object} id
 * @returns
 */
export function offlineInterface(id) {
  return http.put('/interface/approve', id)
}
